<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml">

    <ui:define name="top">
        Edit Categories
    </ui:define>

    <ui:define name="left">
    </ui:define>
    
    <ui:define name="body">
        <h:form>
            <h:dataTable width="100%" rendered="#{categoryCTRL.categoryModel.rowCount >0}" value="#{categoryCTRL.categoryModel}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Category"/>
                </f:facet>
                <h:outputText value="#{item.level}#{item.name}"/>
            </h:column>
            <h:column>
                <h:commandLink value="View" action="#{categoryCTRL.selectCategoryForEditing}"/>
            </h:column>
            <h:column>
                <h:commandLink value="Delete" action="#{categoryCTRL.deleteCategory}"/>
            </h:column>
        </h:dataTable>
        </h:form>
    </ui:define>

</ui:composition>
